package collection;

import java.util.*;

public class TestTreeSetWithComparator {
	public static void main(String[] args){
		Set<GeometricObject> set = new TreeSet<GeometricObject>(new GeometricObjectComparator());
		set.add(new Rectangle(4,5));
		set.add(new Circle(40));
		set.add(new Circle(40));
		set.add(new Rectangle(4,4));
		
		new Circle(20).printCircle();
		
		System.out.println("A sorted set of geometric objects:");
		for(GeometricObject g : set)
			System.out.println("area = " + g.getArea());
	}
}
